<?php
/*
 * 手机客户端 秀场作品评论回复接口
 * 传入参数 
 * 2013-12-011
 */
include "inc/public_header.php";
 
include "func/user.php";				//用户信息处理函数

$reJson = array();//构建返回值
 
$acontent 		= $_REQUEST["content"];		//用户提交内容
$pid 			= $_REQUEST["commentid"];	//评论主键
$vcode			= $_REQUEST["vcode"];				//图片验证码
$platform		= $_REQUEST["platform"];				//平台编号
$version		= $_REQUEST["ver"];			//版本号

//获取用户信息
$uInfoArr = user_getInfoFromUUID();
if(!$uInfoArr){
	echo json_encode(array("success"=>"0","errCode"=>"0","msg"=>"没有获取到用户信息"));
	die;
}
$uid = $uInfoArr["uid"];//用户信息主键

if ($platform == 1||$version>1.4){
//判断验证码
$sql = "select avalue from user_phone_imgvcode where uuid='".$_REQUEST["uuid"]."' and away='2'";
$db->query($sql);
if(!(isset($vcode) && $vcode!="" && $db->next_record() && $vcode==$db->f("avalue"))){
	echo json_encode(array("success"=>"0","errCode"=>"2","msg"=>"验证码错误"));
	die;
}
}

$sql="select zpid from new_weituo_comment where id='".$pid."'";
$db->query($sql);
$db->next_record();
$zpid = $db->f(zpid);

//提交回复
$sql = "insert into new_weituo_huifu (uid,pid,ctime,acontent,zpid) values('".$uid."','".$pid."',now(),'".$acontent."','".$zpid."')";
$db->query($sql);
$reJson["success"] = "1";
echo json_encode($reJson);
?>